{% extends 'base.html' %}
{% block title %}
博客主页
{% endblock %}

{% block content %}
<div class="container-xl">
    <form method="POST" class="form-signin" enctype="multipart/form-data">
        {{ form.hidden_tag() }}
        <br>
        <h1 class="h3 mb-3 font-weight-normal">
            上传页面
        </h1>
        <br>
        {{ form.image_file.label }}
        {{ form.image_file(class="form-control") }}
         <br>
        {{ form.submit(class="btn btn-lg btn-primary btn-primary") }}
    </form>
    <hr/>
    <div class="row">
        {% if image_filenames %}
            {% for image_file in image_filenames %}
                <div class="col-md-3">
                    <br>
                    <b>/image/{{ image_file }}</b>
                    <img src="/image/{{ image_file }}" class="img-thumbnail my-2" style="width: 300px;" height="200px;"/>
                        <a href="/image/{{ image_file }}" class="btn btn-primary">查看</a>
                        <a class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#Modal-DeleteConfirm-{{ image_file }}">删除</a>
                </div>
            {% endfor %}
        {% endif %}
    </div>
</div>
{% endblock %}
